# -*- coding: utf-8 -*-
# @File : test1.py
# @Time : 2024/5/23 10:23
# @Author : syq
# @Email : 1721169065@qq.com
# @Software: PyCharm
# 创建浏览器驱动对象，这里是打开浏览器
"""
只是为了说明selenium定位分闸断开时，弹框显示正常
"""
import time

from selenium import webdriver

driver = webdriver.Chrome("E:\愤怒吧小鸟\chromedriver-win64\chromedriver.exe")

# 访问网址，公司公网的大屏
driver.get("http://192.168.7.85:1777")
#全屏
driver.maximize_window()
time.sleep(3)
#登录
driver.find_element_by_css_selector(".login-div>div:nth-child(2) .el-input__inner").send_keys('admin')
driver.find_element_by_css_selector(".login-div>div:nth-child(4) .el-input__inner").send_keys('admin')
driver.find_element_by_css_selector(".submit-btn").click()
time.sleep(2)
#iframe标签
ifa = driver.find_element_by_css_selector("iframe")
# 找到之后，就可以去切换了
driver.switch_to.frame(ifa)
# time.sleep(3)
#定位分闸控制 并点击
driver.find_element_by_css_selector(".work-order div[class='item-btn flex items-center']").click()
#定位喇叭分闸断开，并点击
driver.find_element_by_css_selector(".work-order >div:nth-child(2)>div:nth-child(2) .control-name").click()
